package com.example.websocket.websocket.controller;

import com.example.websocket.websocket.pojo.Result;
import com.example.websocket.websocket.pojo.User;
import com.example.websocket.websocket.pojo.UserThreadLocal;
import com.example.websocket.websocket.ws.ChatEndpoint;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;


/**
 * @program: websocket
 * @description:
 * @author: fks
 * @create: 2025-03-23 15:39
 **/

@RestController
@RequestMapping("/login")
public class UserController {

    @PostMapping("/login")
    public Result login(@RequestBody User user, HttpSession session){
        Result result = new Result();
        session.setAttribute("username",user.getUsername());
        return result;
    }

}
